/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package prjtgl.controler;

import org.zkoss.bind.annotation.*;
import prjtgl.metier.*;
import prjtgl.metier.comptes.*;

/**
 *
 * @author Adrien
 */
public class MainLayoutComposer {

	Utilisateur current_user;
	Application app = Application.getInstance();
	String _value = "value";
	String _currentPage = "connexion.zul";
	String _currentTop = null;
	String _currentLeft = null;

	public String getCurrentTop() {
		return _currentTop;
	}

	public void setCurrentTop(String currentPage) {
		_currentTop = currentPage;
	}

	public String getCurrentLeft() {
		return _currentLeft;
	}

	public void setCurrentLeft(String currentPage) {
		_currentLeft = currentPage;
	}

	public String getCurrentPage() {
		return _currentPage;
	}

	public void setCurrentPage(String currentPage) {
		_currentPage = currentPage;
	}

	public String getValue() {
		return _value;
	}


	@GlobalCommand
	@Command
	@NotifyChange({"currentPage", "currentTop", "currentLeft"})
	public void changePage(@BindingParam("content") String content) {
		_currentPage = content;
		if (content.contains("Membre/")) {
                    if(content.contains("Inscription")) {
                        _currentTop = "Admin/nav.zul";
			_currentLeft = "Admin/nav.zul";
                    }else{
			_currentTop = "Membre/entete.zul";
			_currentLeft = "Membre/nav.zul";
                    }
		} else if (content.contains("Recruteur/")) {
                    if(content.contains("Inscription")) {
                        _currentTop = "Admin/nav.zul";
			_currentLeft = "Admin/nav.zul";
                    }else{
			_currentTop = "Recruteur/entete.zul";
			_currentLeft = "Admin/nav.zul";
                    }
		} else if(content.contains("Admin/")){
                        _currentTop = "Admin/entete.zul";
			_currentLeft = "Admin/nav.zul";
                
                }else{
			System.out.println(" LAPIN ERREUR");

			//_currentPage= "MotDePasseOublie.zul";
			_currentTop = "Admin/nav.zul";
			_currentLeft = "Admin/nav.zul";
		}

	}

	private boolean isUserChange(String str) {
		//TODO 
		return false;
	}
}
